package com.ocom.webapi.service.impl;

import com.ocom.common.constant.MapKey;
import com.ocom.common.resp.Result;
import com.ocom.security.utils.SecurityUtils;
import com.ocom.webapi.feign.HumanClientService;
import com.ocom.webapi.service.VisitorRecordService;
import com.ocom.webapi.vo.visitorrecord.OnShowVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class VisitorRecordServiceImpl implements VisitorRecordService {
    @Autowired
    private HumanClientService humanClientService;

    @Override
    public Result VisitorRecordOnShow(OnShowVo onShowVo) {
        Map<String, Object> map = new HashMap<>();
        MapKey mapKey = new MapKey();
        map.put(mapKey.getKey_comId(), SecurityUtils.getYoCiUser().getComId());
        map.put(mapKey.getKey_groupNo(),onShowVo.getGroupNo());
        map.put(mapKey.getKey_deptId(),onShowVo.getDeptId());
        map.put(mapKey.getKey_deptName(),onShowVo.getDeptName());
        map.put(mapKey.getKey_approverId(),onShowVo.getApproverId());
        map.put(mapKey.getKey_approverName(),onShowVo.getApproverName());
        map.put(mapKey.getKey_visitorName(),onShowVo.getVisitorName());
        map.put(mapKey.getKey_beginTime(),onShowVo.getBeginTime());
        map.put(mapKey.getKey_endTime(),onShowVo.getEndTime());
        map.put(mapKey.getKey_approverStatus(),onShowVo.getApproverStatus());
        map.put(mapKey.getKey_deviceNos(),onShowVo.getDeviceNos());
        map.put(mapKey.getKey_page(),onShowVo.getPage());
        map.put(mapKey.getKey_size(),onShowVo.getSize());
        return humanClientService.GetVisitorApprover(map);
    }
}
